﻿using System;
using System.ServiceModel;

namespace Prompts.Service.Construction
{
    public class WcfServiceHost : ServiceHost
    {
        private readonly Type _serviceType;

        public WcfServiceHost(Type serviceType, params Uri[] baseAddresses)
            : base(serviceType, baseAddresses)
        {
            _serviceType = serviceType;
        }

        protected override void OnOpening()
        {
            Description.Behaviors.Add(new WcfServiceBehavior(_serviceType));
            base.OnOpening();
        }
    }
}